package com.indusfo.spc.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.indusfo.spc.common.pojo.BasePojo;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Transient;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * 生产任务单
 */
public class Order extends BasePojo {
    /**
     * 任务单id
     */
    private Integer orderId;
    /**
     * 任务单号
     */
    private String orderNo;
    /**
     * 开始时间
     */
    private String startDate;
    /**
     * 结束时间
     */
    private String endDate;
    /**
     * 发布日期
     */
    private String pushDate;
    /**
     * 物料id
     */
    private Integer matId;
    /**
     * 产线id
     */
    private Integer productlineId;
    /**
     * 单位id
     */
    private Integer unitId;
    /**
     * 用户id
     */
    private Integer userId;

    /**
     * 任务单类型id
     */
    private Integer orderTypeId;
    /**
     * 班次id
     */
    private Integer classeId;
    /**
     * 版本号
     */
    private Integer matVerId;

    /**
     * 计划数量
     */
    private Integer planNum;
    /**
     * 报工数量
     */
    private Integer finishNum;
    /**
     * 投入数量
     */
    private Integer inputNum;
    /**
     * 未完工数量
     */
    private Integer unfinishNum;
    /**
     * 实际开始时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date actualStartDate;
    /**
     * 实际结束时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date actualEndDate;
    /**
     * 执行状态id
     */
    private Integer executeStateId;
    /**
     * 最后一次执行状态id
     */
    private Integer lastExecuteStateId;

    /**
     *
     */
    private String createDate;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date modifyDate;

    private String remark;

    private Integer dataState;


    /**
     * @author: louk
     * @Description:以上数据库定义字段,以下是衍生字段
     * @date: 2019/11/23 9:09
     *
     */
    /**
     * 用户名
     */
    private String userName;

    /**
     * 数据状态名称
     */
    private String dataStateName;

    /**
     * 执行状态名称
     */
    private String executeStateName;

    /**
     * 车间id
     */
    private Integer workshopId;
    /**
     * 车间名称
     */
    private String workshopName;
    /**
     * 产线名称
     */
    private String productlineName;
    /**
     * 班次名称
     */
    private String classeName;
    /**
     * 任务单类型名称
     */
    private String orderTypeName;

    /**
     * 物料编号
     */
    private String matCode;
    /**
     * 产品名称
     */
    private String matName;
    /**
     * 版本名称
     */
    private String matVerName;

    /**
     * 规格型号
     */
    private String matModel;

    /**
     * 任务单工序流程集合
     */
    private List<OrderFlow> orderFlowList;

    /**
     * 任务单维修流程集合
     */
    private List<OrderRepair> orderRepairList;

    @Transient
    private String  beginTime;

    @Transient
    private String endTime;
    /**
     * @Author 熊冰  批次id做保存用
     * @Date 2019/12/26 10:27
     */
    private Integer batchId;
    /**
     * @Author 熊冰 版本id 用作批次是否新增判断
     * @Date 2019/12/26 10:51
     */
    private Integer orderTechId;


    /**
     * @Author 熊冰  完成进度  用于首页
     * @Date 2020/3/23 15:27
     */
    private String finishRate;

    /**
     * @Author 熊冰 时间分类  1 当天 2 本周 3 本月 4 本季度 5 本年度 6 当天八点 7 近七天 8 近30天  9 近 一年
     * @Date 2020/3/23 14:14
     */
    private Integer dateStateId;

    /**
     * 物料类型id
     */
    private Integer artifactTypeId;
    //物料类型名称
    private String artifactTypeIdName;

    public Integer getArtifactTypeId() {
        return artifactTypeId;
    }

    public void setArtifactTypeId(Integer artifactTypeId) {
        this.artifactTypeId = artifactTypeId;
    }

    public String getArtifactTypeIdName() {
        return artifactTypeIdName;
    }

    public void setArtifactTypeIdName(String artifactTypeIdName) {
        this.artifactTypeIdName = artifactTypeIdName;
    }

    public Integer getDateStateId() {
        return dateStateId;
    }

    public void setDateStateId(Integer dateStateId) {
        this.dateStateId = dateStateId;
    }

    public String getFinishRate() {
        return finishRate;
    }

    public void setFinishRate(String finishRate) {
        this.finishRate = finishRate;
    }

    public Integer getOrderTechId() {
        return orderTechId;
    }

    public void setOrderTechId(Integer orderTechId) {
        this.orderTechId = orderTechId;
    }

    public Integer getBatchId() {
        return batchId;
    }

    public void setBatchId(Integer batchId) {
        this.batchId = batchId;
    }

    public Integer getWorkshopId() {
        return workshopId;
    }

    public void setWorkshopId(Integer workshopId) {
        this.workshopId = workshopId;
    }

    public String getMatModel() {
        return matModel;
    }

    public void setMatModel(String matModel) {
        this.matModel = matModel;
    }

    public String getMatCode() {
        return matCode;
    }

    public void setMatCode(String matCode) {
        this.matCode = matCode;
    }

    public String getMatName() {
        return matName;
    }

    public void setMatName(String matName) {
        this.matName = matName;
    }

    public String getMatVerName() {
        return matVerName;
    }

    public void setMatVerName(String matVerName) {
        this.matVerName = matVerName;
    }

    public String getOrderTypeName() {
        return orderTypeName;
    }

    public void setOrderTypeName(String orderTypeName) {
        this.orderTypeName = orderTypeName;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getDataStateName() {
        return dataStateName;
    }

    public void setDataStateName(String dataStateName) {
        this.dataStateName = dataStateName;
    }

    public String getExecuteStateName() {
        return executeStateName;
    }

    public void setExecuteStateName(String executeStateName) {
        this.executeStateName = executeStateName;
    }

    public String getWorkshopName() {
        return workshopName;
    }

    public void setWorkshopName(String workshopName) {
        this.workshopName = workshopName;
    }

    public String getProductlineName() {
        return productlineName;
    }

    public void setProductlineName(String productlineName) {
        this.productlineName = productlineName;
    }

    public String getClasseName() {
        return classeName;
    }

    public void setClasseName(String classeName) {
        this.classeName = classeName;
    }

    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo == null ? null : orderNo.trim().replace(" ","");
    }


    public Integer getMatId() {
        return matId;
    }

    public void setMatId(Integer matId) {
        this.matId = matId;
    }

    public Integer getProductlineId() {
        return productlineId;
    }

    public void setProductlineId(Integer productlineId) {
        this.productlineId = productlineId;
    }

    public Integer getUnitId() {
        return unitId;
    }

    public void setUnitId(Integer unitId) {
        this.unitId = unitId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getOrderTypeId() {
        return orderTypeId;
    }

    public void setOrderTypeId(Integer orderTypeId) {
        this.orderTypeId = orderTypeId;
    }

    public Integer getClasseId() {
        return classeId;
    }

    public void setClasseId(Integer classeId) {
        this.classeId = classeId;
    }

    public Integer getMatVerId() {
        return matVerId;
    }

    public void setMatVerId(Integer matVerId) {
        this.matVerId = matVerId;
    }

    public Integer getPlanNum() {
        return planNum;
    }

    public void setPlanNum(Integer planNum) {
        this.planNum = planNum;
    }

    public Integer getFinishNum() {
        return finishNum;
    }

    public void setFinishNum(Integer finishNum) {
        this.finishNum = finishNum;
    }

    public Integer getInputNum() {
        return inputNum;
    }

    public void setInputNum(Integer inputNum) {
        this.inputNum = inputNum;
    }

    public Integer getUnfinishNum() {
        return unfinishNum;
    }

    public void setUnfinishNum(Integer unfinishNum) {
        this.unfinishNum = unfinishNum;
    }


    public Integer getExecuteStateId() {
        return executeStateId;
    }

    public void setExecuteStateId(Integer executeStateId) {
        this.executeStateId = executeStateId;
    }

    public Integer getLastExecuteStateId() {
        return lastExecuteStateId;
    }

    public void setLastExecuteStateId(Integer lastExecuteStateId) {
        this.lastExecuteStateId = lastExecuteStateId;
    }

    public String getCreateDate() {
        return createDate;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    public Date getModifyDate() {
        return modifyDate;
    }

    public void setModifyDate(Date modifyDate) {
        this.modifyDate = modifyDate;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark == null ? null : remark.trim().replace(" ","");
    }

    public Integer getDataState() {
        return dataState;
    }

    public void setDataState(Integer dataState) {
        this.dataState = dataState;
    }

    public String getStartDate() {
        return startDate;
    }

    public void setStartDate(String startDate) {
        this.startDate = startDate;
    }

    public String getEndDate() {
        return endDate;
    }

    public void setEndDate(String endDate) {
        this.endDate = endDate;
    }

    public String getPushDate() {
        return pushDate;
    }

    public void setPushDate(String pushDate) {
        this.pushDate = pushDate;
    }

    
   
    public Date getActualStartDate() {
		return actualStartDate;
	}

	public void setActualStartDate(Date actualStartDate) {
		this.actualStartDate = actualStartDate;
	}

	public Date getActualEndDate() {
		return actualEndDate;
	}

	public void setActualEndDate(Date actualEndDate) {
		this.actualEndDate = actualEndDate;
	}

	public List<OrderFlow> getOrderFlowList() {
        return orderFlowList;
    }

    public void setOrderFlowList(List<OrderFlow> orderFlowList) {
        this.orderFlowList = orderFlowList;
    }

    public List<OrderRepair> getOrderRepairList() {
        return orderRepairList;
    }

    public void setOrderRepairList(List<OrderRepair> orderRepairList) {
        this.orderRepairList = orderRepairList;
    }

  public String getBeginTime() {
    return beginTime;
  }

  public void setBeginTime(String beginTime) {
    this.beginTime = beginTime;
  }

  public String getEndTime() {
    return endTime;
  }

  public void setEndTime(String endTime) {
    this.endTime = endTime;
  }
}
